/*
 * Copyright (C) 2014 Realtek Semiconductor Corp.
 * All Rights Reserved.
 *
 * This program is the proprietary software of Realtek Semiconductor
 * Corporation and/or its licensors, and only be used, duplicated,
 * modified or distributed under the authorized license from Realtek.
 *
 * ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
 * THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
 *
 * Purpose : Definition internal feature flag value for FAL
 *
 * Feature : The file includes the following modules and sub-modules
 *           (1)
 */


/*For customized bridge data path*/
#define CUSTOM_BDP_TLS_4095             		0x00000001
#define CUSTOM_BDP_DS_NOT_FILTER_PBIT   		0x00000002
#define CUSTOM_BDP_MULTIQ_PER_GEM       		0x00000004
#define CUSTOM_BDP_US_VLANTAG_OPER_MODE_0xF 	0x00000008
#define CUSTOM_BDP_TRAP_DS_BC_GEM_PKT_TO_SW 	0x00000010
#define CUSTOM_BDP_CVID_EUQ_SVID_AS_SINGLE_TAG 	0x00000020
#define CUSTOM_BDP_ONLY_ANI_CONN			 	0x00000040
#define CUSTOM_BDP_INGORE_EXTV_DEFAULT_DROP	  	0x00000080
#define CUSTOM_BDP_FORCE_VEIP_RULE_TO_SFU	  	0x00000100
#define CUSTOM_BDP_SET_DSPRIQ_WEIGHT_APPLY_USPRIQ	0x00000200
#define CUSTOM_BDP_MODIFY_VOTD_FWDOP            0x00000400
#define CUSTOM_BDP_FORCE_DIFF_GEM_TO_DIFF_QUEUE 0x00000800


/*For customized routing data path*/
#define CUSTOM_RDP_USE_PPTP_INSTEAD_OF_VEIP		0x00000001
#define CUSTOM_RDP_FORCE_DS_BRIDGE_UNTAGGED     0x00000002
#define CUSTOM_RDP_IGNORE_CONN_UNINODE_CHECK    0x00000004
#define CUSTOM_RDP_FORCE_IPHOST_0_AS_TR069      0x00000008
#define CUSTOM_RDP_FORCE_IPHOST_1_AS_SIP        0x00000010
#define CUSTOM_RDP_IPHOST_FROM_FILTER           0x00000020
#define CUSTOM_RDP_UPDATE_TR069_TCI_BY_ASCOTAG  0x00000040

/*For customized multicast*/
#define CUSTOM_MC_FORCE_DS_MCAST_UNTAGGED      0x00000001
#define CUSTOM_MC_FORCE_UNAUTH_JOIN_FORWARD     0x00000002
#define CUSTOM_MC_DISABLE_MCASTSVCPKGTBL_SUPPORT 0x00000004
#define CUSTOM_MC_DS_GEM_FORCE_IGNORE_VLAN_RULE 0x00000008

/*For customized ME*/
#define CUSTOM_ME_FE_SLOT_ID_EQUL_TO_GE_SLOT_ID 0x00000001
#define CUSTOM_ME_SW_IMG_DELAY_INVALIDATION     0x00000002
#define CUSTOM_ME_ACCEPT_DUPLICATE_CREATE       0x00000004
#define CUSTOM_ME_FORCE_MBPCD_FFFF_MCAST_GEM    0x00000008
#define CUSTOM_ME_SYNC_TR69_STATE_WITH_VEIP     0x00000010
#define CUSTOM_ME_SUPPORT_VOIP_IMAGE            0x00000020
#define CUSTOM_ME_SUPPORT_ONU_CAPABILITY     	0x00000040
#define CUSTOM_ME_APPLY_CUSTOMIZED_ONU_TYPE     0x00000080
#define CUSTOM_ME_APPLY_CUSTOMIZED_VEIP_SLOT_ID 0x00000100
#define CUSTOM_ME_REVERSE_FE_GE_PORT_SEQUENCE   0x00000200
#define CUSTOM_ME_SUPPORT_EXTENDED_ONU_G        0x00000400
#define CUSTOM_ME_SUPPORT_HIDDEN_ONU_G_FF01     0x00000800
#define CUSTOM_ME_NO_SEND_ALARM                 0x00001000
#define CUSTOM_ME_FORCE_O7_WHEN_PPTP_LOCKED     0x00002000
#define CUSTOM_ME_SUPPORT_LAN_ISOLATION		    0x00004000
#define CUSTOM_ME_NO_CARDHOLDER_ACTUALTYPE_AVC  0x00008000
#define CUSTOM_ME_ACCEPT_INVALID_PQ_ID          0x00010000
#define CUSTOM_ME_ENABLE_PORT_REMAPPING         0x00020000
#define CUSTOM_ME_UPLOAD_BY_CLASSID             0x00040000
#define CUSTOM_ME_FROCE_PIRCIR_DEFAULT_BY_POLICY 0x00080000
#define CUSTOM_ME_UPLOAD_TCONT_NUMBER_BY_USER      0x00100000
#define CUSTOM_ME_RESERVED                      0x00200000
#define CUSTOM_ME_SET_RDI_MODE		            0x00400000
#define CUSTOM_ME_PPTPUNI_IGNORE_UNIG           0x00800000
#define CUSTOM_ME_UPLOAD_WAN_IFNO               0x01000000
#define CUSTOM_ME_PPTPUNI_PORT_ABILITY          0x02000000

/* Note: below configuration should be updated if insert new customized flag */
static unsigned int customize_set[4][32] =
{
    	{CUSTOM_BDP_TLS_4095,
    	CUSTOM_BDP_DS_NOT_FILTER_PBIT,
    	CUSTOM_BDP_MULTIQ_PER_GEM,
    	CUSTOM_BDP_US_VLANTAG_OPER_MODE_0xF,
    	CUSTOM_BDP_TRAP_DS_BC_GEM_PKT_TO_SW,
    	CUSTOM_BDP_CVID_EUQ_SVID_AS_SINGLE_TAG,
    	CUSTOM_BDP_ONLY_ANI_CONN,
    	CUSTOM_BDP_INGORE_EXTV_DEFAULT_DROP,
    	CUSTOM_BDP_FORCE_VEIP_RULE_TO_SFU,
        CUSTOM_BDP_SET_DSPRIQ_WEIGHT_APPLY_USPRIQ,
        CUSTOM_BDP_MODIFY_VOTD_FWDOP,
        CUSTOM_BDP_FORCE_DIFF_GEM_TO_DIFF_QUEUE,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

    	{CUSTOM_RDP_USE_PPTP_INSTEAD_OF_VEIP,
    	CUSTOM_RDP_FORCE_DS_BRIDGE_UNTAGGED,
    	CUSTOM_RDP_IGNORE_CONN_UNINODE_CHECK,
    	CUSTOM_RDP_FORCE_IPHOST_0_AS_TR069,
    	CUSTOM_RDP_FORCE_IPHOST_1_AS_SIP,
    	CUSTOM_RDP_IPHOST_FROM_FILTER,
    	CUSTOM_RDP_UPDATE_TR069_TCI_BY_ASCOTAG,
    	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

    	{CUSTOM_MC_FORCE_DS_MCAST_UNTAGGED,
        CUSTOM_MC_FORCE_UNAUTH_JOIN_FORWARD,
        CUSTOM_MC_DISABLE_MCASTSVCPKGTBL_SUPPORT,
        CUSTOM_MC_DS_GEM_FORCE_IGNORE_VLAN_RULE,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

    	{CUSTOM_ME_FE_SLOT_ID_EQUL_TO_GE_SLOT_ID,
    	CUSTOM_ME_SW_IMG_DELAY_INVALIDATION,
        CUSTOM_ME_ACCEPT_DUPLICATE_CREATE,
        CUSTOM_ME_FORCE_MBPCD_FFFF_MCAST_GEM,
        CUSTOM_ME_SYNC_TR69_STATE_WITH_VEIP,
        CUSTOM_ME_SUPPORT_VOIP_IMAGE,
        CUSTOM_ME_SUPPORT_ONU_CAPABILITY,
        CUSTOM_ME_APPLY_CUSTOMIZED_ONU_TYPE,
        CUSTOM_ME_APPLY_CUSTOMIZED_VEIP_SLOT_ID,
        CUSTOM_ME_REVERSE_FE_GE_PORT_SEQUENCE,
        CUSTOM_ME_SUPPORT_EXTENDED_ONU_G,
        CUSTOM_ME_SUPPORT_HIDDEN_ONU_G_FF01,
        CUSTOM_ME_NO_SEND_ALARM,
        CUSTOM_ME_FORCE_O7_WHEN_PPTP_LOCKED,
        CUSTOM_ME_SUPPORT_LAN_ISOLATION,
        CUSTOM_ME_NO_CARDHOLDER_ACTUALTYPE_AVC,
        CUSTOM_ME_ACCEPT_INVALID_PQ_ID,
        CUSTOM_ME_ENABLE_PORT_REMAPPING,
        CUSTOM_ME_UPLOAD_BY_CLASSID,
        CUSTOM_ME_FROCE_PIRCIR_DEFAULT_BY_POLICY,
        CUSTOM_ME_UPLOAD_TCONT_NUMBER_BY_USER,
        CUSTOM_ME_RESERVED,
        CUSTOM_ME_SET_RDI_MODE,
        CUSTOM_ME_PPTPUNI_IGNORE_UNIG,
        CUSTOM_ME_UPLOAD_WAN_IFNO,
        CUSTOM_ME_PPTPUNI_PORT_ABILITY,
	0, 0, 0, 0, 0, 0}
};

static char *customize_prefix[] =
{
    "bdp_",
    "rdp_",
    "mc_",
    "me_",
};


unsigned int feature_max_col_get(void)
{
	return (sizeof(customize_set[0]) / sizeof(customize_set[0][0]));
}

int feature_info_get(unsigned int **ptr)
{
	unsigned int i;
	if (!ptr)
		return -1;

	for (i = 0; i < (sizeof(customize_set) / sizeof(customize_set[0])); i++)
	{
		*(ptr + i) = &(customize_set[i][0]);
	}

	return 0;
}

char ** feature_prefix_info_get(void)
{
	return &customize_prefix[0];
}
